package la.bbs558.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import la.bbs558.entity.BbsReply;
import la.bbs558.entity.vo.BbsReplyVO;
import la.bbs558.entity.params.BbsPostDetailPage;
import la.bbs558.entity.params.ReplySearchPage;
import la.bbs558.entity.params.UserCenterSearchPage;
import org.apache.ibatis.annotations.Param;

/**
 * 回复(BbsReply)表数据库访问层
 *
 * @author Shanks
 * @since 2023-12-15 22:40:44
 */
public interface BbsReplyDao extends BaseMapper<BbsReply> {

    Page<BbsReplyVO> selectByPageForAdmin(@Param("search") ReplySearchPage searchPage);
    Page<BbsReplyVO> replyList(BbsPostDetailPage page);

    void updateReplyCnt(@Param("id") Long id);

    Page<BbsReplyVO> selectListByUserId(@Param("search") UserCenterSearchPage<BbsReplyVO> searchPage);

    int collectOrLikeForPost(@Param("id")Long postId, @Param("type") Integer type, @Param("cnt") int cnt);
    int likeForReply(@Param("id")Long reply, @Param("type") Integer type, @Param("cnt") int cnt);

    void deleteByPostId(@Param("id") Long id);

    BbsReplyVO selectReplyById(Long replyId);
}

